﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace IronCow.UnitTests.Mock
{
    class MockErrorResponse : MockResponse
    {
        private int mErrorCode;

        public MockErrorResponse(int errorCode)
        {
            mErrorCode = errorCode;
        }

		public override void GetResponseMarkup(System.Xml.XmlWriter markupWriter, Dictionary<string, string> parameters)
        {
            markupWriter.WriteStartDocument();
            markupWriter.WriteStartElement("rsp");
            markupWriter.WriteAttributeString("stat", "fail");
            {
                markupWriter.WriteStartElement("err");
                markupWriter.WriteAttributeString("code", mErrorCode.ToString());
                markupWriter.WriteAttributeString("msg", "");
                markupWriter.WriteEndElement();
            }
            markupWriter.WriteEndElement();
            markupWriter.WriteEndDocument();
        }
    }
}
